<?php

//login
$route->any('test', 'OfficialAccountController@test');
$route->any('code', 'AuthController@code');
$route->any('official/account', 'OfficialAccountController@handle');
$route->any('notify', 'PayController@ali_notify');
$route->any('ali/pay/query', 'PayController@ali_query');
$route->any('wx/pay/query', 'PayController@wx_query');
$route->any('login', 'AuthController@login');
$route->any('wx/login', 'AuthController@wx_login');
$route->any('qiniu/notify', 'QiNiuController@notify');
//category
$route->get('category/index', 'CategoryController@index');

//cookbook
$route->get('cookbook/index', 'CookbookController@index');
$route->get('cookbook/info', 'CookbookController@info');

//食谱集合
$route->get('collect/index', 'CookbookCollectController@index');

$route->any('comment/index', 'CommentController@index');

$route->get('notebook/index', 'NotebookController@index');

$route->get('package/setting/index', 'PackageSettingController@index');

$route->any('wx/notify', 'PayController@wx_notify');
$route->any('wx/refund/notify', 'PayController@wx_refund_notify')->name('wx.refund.notify');

//banner
$route->get('banner/index', 'BannerController@index');
$route->get('problem/index', 'ProblemController@index');

//零元购
$route->get('zero/index', 'ZeroProductController@index');
$route->get('zero/info', 'ZeroProductController@info');

#=============================== mall ====================================
$route->get('product/index', 'ProductController@index');
$route->get('product/info', 'ProductController@info');
#=============================== end mall ====================================

$route->group(['middleware' => 'api.auth'], function ($route) {

    //safe
    $route->any('safe/check', 'InitController@safe_check');

    $route->get('init', 'InitController@init');

    //token
    $route->any('qiniu/token', 'QiNiuController@getToken');

    //cookbook
    $route->get('cookbook/view/history', 'CookbookController@viewHistory');
    $route->get('cookbook/collect', 'CookbookController@collect');
    $route->get('cookbook/collect/info', 'CookbookController@collectInfo');

    $route->any('cookbook/view/adv', 'CookbookController@viewAdv');

    //comment
    $route->any('comment/store', 'CommentController@store');
    $route->any('comment/destroy', 'CommentController@destroy');

    //notebook

    $route->any('notebook/store', 'NotebookController@store');
    $route->any('notebook/destroy', 'NotebookController@destroy');

    //star
    $route->any('star/store', 'StarController@store');
    //focus
    $route->any('focus/store', 'FocusController@store');
    //notification
    $route->get('notification/index', 'NotificationController@index');

    //我的
    $route->get('user/index', 'UserController@index');
    //fans
    $route->get('user/fans', 'UserController@fans');
    //focus
    $route->get('user/focus', 'UserController@focus');

    //order
    $route->get('order/index', 'OrderController@index');

    $route->any('create/pay', 'OrderController@createPay');



    #=============================== mall ====================================

    //cart
    $route->any('cart/index', 'CartController@index');
    $route->any('v2/cart/index', 'CartController@index_v2');
    $route->any('cart/store', 'CartController@store');
    $route->any('cart/destroy', 'CartController@destroy');

    //省市区
    $route->any('province', 'ProvinceController@getProvinceList');
    $route->any('city', 'ProvinceController@getCity');
    $route->any('area', 'ProvinceController@getArea');

    $route->any('address/index', 'AddressController@index');
    $route->any('address/store', 'AddressController@store');
    $route->any('order/address/update', 'AddressController@updateOrderAddress');
    $route->any('address/info', 'AddressController@info');
    $route->any('address/destroy', 'AddressController@destroy');

    //商城订单
    $route->any('mall/order/create', 'MallOrderController@createOrder');
    $route->any('mall/order/pay', 'MallOrderController@createPay');

    //订单列表
    $route->any('mall/order/index', 'MallOrderController@index');
    $route->any('mall/order/info', 'MallOrderController@info');
    $route->any('mall/order/product/info', 'MallOrderController@order_product_info');
    $route->any('mall/order/destroy', 'MallOrderController@destroy');
    //取消订单
    $route->any('mall/order/cancel', 'MallOrderController@cancel');
    //收货
    $route->any('mall/take/deliver', 'MallOrderController@takeDeliver');

    //申请退款
    $route->any('mall/apply/refund', 'MallOrderController@apply_refund');
    $route->any('mall/refund/cancel', 'MallOrderController@cancel_refund');
    $route->any('mall/refund/info', 'MallOrderController@refund_info');
    //退款补充快递
    $route->any('mall/refund/supply', 'MallOrderController@refund_supply_express');

    //快递
    $route->any('mall/express/index', 'ExpressController@index');
    $route->any('mall/express/info', 'ExpressController@info');

    //comment
    $route->any('mall/order/comment/store', 'OrderCommentController@store');
    $route->any('mall/order/comment/index', 'OrderCommentController@index');
    $route->any('mall/order/comment/info', 'OrderCommentController@info');


    //关联
    $route->any('merchant/relate', 'AuthController@relate');

    //团队管理
    $route->any('team/index', 'TeamController@index');

    //转连
    $route->any('link/index', 'LinkController@index');
    $route->any('link/store', 'LinkController@store');

    //提现
    $route->any('withdraw/apply', 'WithdrawController@apply');
    $route->any('withdraw/index', 'WithdrawController@index');

    //我的钱包
    $route->any('flow', 'BalanceController@index');

    $route->any('qrcode', 'UserController@qrcode');


});
